package com.tj.pystandard.tjgateway.constant;

import java.util.Arrays;
import java.util.List;

/**
 * 系统字段常量
 *
 * @author yinchao
 * @date 2020/2/22 16:59
 */
public class SystemConstant {
    /**
     * 项目名称
     */
    public static final String PROJECT_NAME = "metadata";
    /**
     * 默认过期天数
     */
    public static final int DEFAULT_EXPIRE_DAYS = 365;
    /**
     * 默认密码长度6位
     */
    public static final int DEFAULT_PASSWORD_LENGTH = 6;
    /**
     * 默认登录 弹窗验证码 检查次数
     */
    public static final int DEFAULT_LOGIN_CHECK_TIMES = 3;
    /**
     * 默认密码
     */
    public static final String DEFAULT_PASSWORD = "123456";
    /**
     * 默认密码,6-20位 大小写字母和数字都至少一位
     */
    public static final String DEFAULT_PASSWORD_REX = "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d]{6,20}$";

    /**
     * 默认密码,8-16位 大小写字母和数字都至少一位
     */
    public static final String DEFAULT_PASSWORD_MESSAGE = "密码必须包含大小写字母和数字,长度6-20位";

    /**
     * 默认最大的excel下载数量
     */
    public static final int DEFAULT_MAX_DOWN_EXCEL_NUM = 50000;

    /**
     * 用户id
     */
    public static final String USER_ID = "userId";
    /**
     * 角色id
     */
    public static final String ROLE_ID = "roleId";
    /**
     * 访问权限token
     */
    public static final String TOKEN = "token";
    /**
     * 日志id key
     */
    public static final String LOG_ID = "logId";
    /**
     * 访问ip
     */
    public static final String ACCESS_IP = "accessIp";
    /**
     * 客户端类型
     */
    public static final String CLIENT_TYPE = "clientType";
    /**
     * 客户端
     */
    public static final String CLIENT = "client";
    /**
     * 公司邮箱后缀
     */
    public static final String COMPANY_EMAIL_SUFFIX = "@pystandard.com";
    /**
     * 邮箱正则
     */
    public static final String EMAIL_REX = "[a-z0-9A-Z]+[-|a-z0-9A-Z._]+@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";

    /**
     * 请求缓存参数
     */
    public static final String CACHED_REQ = "cachedRequestBody";

    /**
     * 无需过滤接口
     */
    public static final List<String> NO_NEED_FILTER = Arrays.asList( "swagger", "/v2/api-docs", "/verifyCode", "/login","/check", "/check/login","images");

    /**
     * 无须验证ip的接口
     */
    public static final List<String> NO_IP_FILTER = Arrays.asList( "swagger", "/v2/api-docs", "/verifyCode", "/check" );

    /**
     * 无记录日志接口
     */
    public static final List<String> NO_NEED_LOG = Arrays.asList( "swagger", "/v2/api-docs" );

    /**
     * 接口日志记录开始时间key
     */
    public static final String LOG_START_TIME = "log_start_time";

    /**
     * 大写字母
     */
    public static final String[] UPPER_ALPHABET = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
    /**
     * 小写字母
     */
    public static final String[] LOWER_ALPHABET = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};

    /**
     * 菜单根节点
     */
    public static final String MENU_ROOT_ID = "0";
    /**
     * 公司名称
     */
    public static final String COMPANY_NAME = "普益标准";
}
